package com.alias.app_interface;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

import static java.awt.FlowLayout.LEFT;

public class Interface extends JFrame {
    private JFrame mainForm;
    private JMenuBar mainMenu;
    private JMenuItem menuItemOpen;
    private JMenuItem menuItemExit;
    private JMenuItem menuItemSave;
    private JMenuItem menuItemAbout;
    private JMenuItem menuItemHelp;
    private JMenu menuFile;
    private JMenu menuAbout;
    private JDialog aboutInfo;
    private JLabel aboutLabel;
    private JPanel mainPanel;
    private JButton employeesTableButton;
    private JButton addingForm;
    private JToolTip toolTip;

//    public Interface() {
//        //Main form initialization
//        mainForm = new JFrame();
//        mainForm.setTitle("Employees app");
//        mainForm.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
//        mainForm.setPreferredSize(new Dimension(400, 150));
//        mainForm.setSize(400, 150);
//        //Main menu initialization
//        mainMenu = new JMenuBar();
//        menuFile = new JMenu("File");
//        menuAbout = new JMenu("About");
//        menuItemOpen = new JMenuItem("Open", KeyEvent.VK_O);
//        menuItemOpen.getAccessibleContext().setAccessibleDescription("Open file");
//        menuItemSave = new JMenuItem("Save", KeyEvent.VK_S);
//        menuItemSave.getAccessibleContext().setAccessibleDescription("Save to file");
//        menuItemExit = new JMenuItem("Exit", KeyEvent.VK_E);
//        menuItemExit.getAccessibleContext().setAccessibleDescription("Exits from application");
//        menuItemExit.addActionListener(new ActionListener() {
//            @Override
//            public void actionPerformed(ActionEvent e) {
//                System.exit(0);
//            }
//        });
//        menuFile.setMnemonic(KeyEvent.VK_F);
//        menuFile.getAccessibleContext().setAccessibleDescription("File option");
//        menuFile.add(menuItemOpen);
//        menuFile.add(menuItemSave);
//        menuFile.addSeparator();
//        menuFile.add(menuItemExit);
//        mainMenu.add(menuFile);
//        menuItemAbout = new JMenuItem("About", KeyEvent.VK_A);
//        menuItemAbout.getAccessibleContext().setAccessibleDescription("Info");
//        aboutInfo = new JDialog();
//        aboutInfo.setTitle("Info");
//        aboutInfo.setSize(200, 100);
//        aboutLabel = new JLabel("Author :DioDread");
//        aboutInfo.add(aboutLabel, BorderLayout.CENTER);
//        menuItemAbout.addActionListener(new ActionListener() {
//            @Override
//            public void actionPerformed(ActionEvent e) {
//                //To change body of implemented methods use File | Settings | File Templates.
//                aboutInfo.setVisible(true);
//            }
//        });
//        menuAbout.add(menuItemAbout);
//        menuItemHelp = new JMenuItem("Help", KeyEvent.VK_T);
//        menuItemHelp.getAccessibleContext().setAccessibleDescription("Help people");
//        menuAbout.add(menuItemHelp);
//        menuAbout.setMnemonic(KeyEvent.VK_A);
//        mainMenu.add(menuAbout);
//        mainMenu.setBorderPainted(true);
//        mainMenu.setLayout(new FlowLayout(LEFT));
//        mainForm.add(mainMenu, BorderLayout.NORTH);
//        //Buttons block initialization
//        mainPanel = new JPanel();
//        employeesTableButton = new JButton("Employees table");
//        addingForm = new JButton("Add employee");
//        employeesTableButton.setToolTipText("Show current working employees table.");
//        addingForm.setToolTipText("Start up employee adding form.");
//        mainPanel.add(employeesTableButton, FlowLayout.LEFT);
//        mainPanel.add(addingForm, FlowLayout.LEFT);
//        employeesTableButton.addActionListener(new ActionListener() {
//            @Override
//            public void actionPerformed(ActionEvent e) {
//                EmployeesTable.getInstance();
//            }
//        });
//        addingForm.addActionListener(new ActionListener() {
//            @Override
//            public void actionPerformed(ActionEvent e) {
//                AdditionForm.getInstance("add");
//            }
//        });
//        mainForm.add(mainPanel, BorderLayout.CENTER);
//        //Hint bar initialization
//        toolTip = new JToolTip();
//        toolTip.setTipText("Hint: ");
//        toolTip.setVisible(true);
//        mainForm.add(toolTip, BorderLayout.SOUTH);
//        //Finalization of main form
//        pack();
//        mainForm.setVisible(true);
//    }


}
